package com.seveneight.baijiesteward.ui.user.presenter;

import android.content.Context;

import com.seveneight.baijiesteward.bean.AnyBean;
import com.seveneight.baijiesteward.http.MyCallBack;
import com.seveneight.baijiesteward.ui.user.contract.UploadInfoContract;
import com.seveneight.baijiesteward.ui.user.model.UploadInfoModel;

import okhttp3.RequestBody;

/**
 * Created by user1 on 2018/3/29.
 */

public class UploadInfoPresenter implements UploadInfoContract.UploadInfoPresenter {

    UploadInfoContract.UploadInfoView uploadInfoView;
    UploadInfoContract.UploadInfoModel uploadInfoModel;

    public UploadInfoPresenter(UploadInfoContract.UploadInfoView uploadInfoView) {
        this.uploadInfoView = uploadInfoView;
        uploadInfoModel = new UploadInfoModel();
    }

    @Override
    public void uploadInfo(Context context, RequestBody body) {
        uploadInfoModel.uploadInfo(context,body, new MyCallBack<AnyBean>() {
            @Override
            public void onSuccess(AnyBean anyBean) {
                uploadInfoView.rebackUploadStatus();
            }

            @Override
            public void onFailed() {

            }
        });
    }
}
